#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QString>
#include <QFileDialog>
#include <QDebug>
#include <QTcpSocket>
#include <QHostAddress>
#include <QByteArray>
#include <iostream>
#include <QMap>
#include <QVector>
#include <QPointF>
#include <QChar>
#include "visage.h"

using namespace std;

namespace Ui {
    class MainWindow;
}

enum typeAlpha
{
    c = 'c',
    p = 'p',
    l = 'l'
};

struct elementAlpha
{
    enum typeAlpha type;
    QVector <QPointF> *coordonnee;
};

class MainWindow : public QMainWindow {

    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();
    QString getPath();

protected:
    void changeEvent(QEvent *e);

private:
    Ui::MainWindow *ui;
    QTcpSocket *socket;
    QFileDialog dialog;
    QString fileName;
    QHostAddress ipAdress;
    int port;
    QMap <char, QVector<elementAlpha> *> alpha;
    void initAlphabet();
    QStringList splitNumber(QString chaine,int cute);
    IplImage* QImage2IplImage(QImage * img);
    void envoie(QString chaine);
    C_dessine_visage *visage;

private slots:
    void on_pushButton_clicked();
    void on_initAlpha_clicked();
    void on_btnInitParam_clicked();
    void on_envoyer_clicked();
    void on_parcourir_clicked();
    void displayImage();
};

#endif // MAINWINDOW_H
